package cn.wgx;

import cn.wgx.commons.util.SpringContextHolder;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.cache.annotation.EnableCaching;

@SpringBootApplication
@EnableCaching
@MapperScan("**.entity.mapper")
@ServletComponentScan(basePackages = {"cn.wgx.commons.filter"})
public class EducationBootApplication extends SpringBootServletInitializer {

    public static void main(String[] args) {
        long l = System.currentTimeMillis();
        SpringApplication.run(EducationBootApplication.class, args);
        System.out.println("启动完毕,耗时: " + (System.currentTimeMillis() - l) + " ms, "
                + "启动模式为: " + SpringContextHolder.getActiveProfile());
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(EducationBootApplication.class);
    }
}
